using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Runtime.Serialization;
using System.Collections;
using System.Data;
using System.ComponentModel;
using System.Data.OracleClient;
using WPFExcelReport.Helpers;
using WPFExcelReport.Controls;
namespace WPFExcelReport
{
    public partial class VKAZWECK
    {
        public DataRow Convert2KAZWECK(DataRow dwInput, string ITXDBVERSION, bool IsConvert = false)
        {
            DataSet SResult = new DataSet();
            SResult = QueryKAZWECK(dwInput, 0);
            DataRow dwReturn = null;
            if (SResult.Tables[0].Rows.Count > 0)
            {
                dwReturn = SResult.Tables[0].Rows[0];
            }
            else
            {
                dwReturn = SResult.Tables[0].NewRow();
            }
            switch (ITXDBVERSION)
            {
                case "YGR":
                    #region=========
         dwReturn["KAZMANDANT"] = " ".PadRight(2 ); 
         dwReturn["KAZZWECK"] = " ".PadRight(5 ); 
         dwReturn["KAZVER"] = " ".PadRight(1 ); 
         dwReturn["KAZAENZL"] = " ".PadRight(0 ); 
         dwReturn["KAZAENB"] = " ".PadRight(8 ); 
         dwReturn["KAZAEND"] = " ".PadRight(0 ); 
         dwReturn["KAZNEUB"] = " ".PadRight(8 ); 
         dwReturn["KAZNEUD"] = " ".PadRight(0 ); 
         dwReturn["KAZBEZ"] = " ".PadRight(30 ); 
         dwReturn["KAZGUELT"] = " ".PadRight(1 ); 
         dwReturn["KAZSCHEM"] = " ".PadRight(5 ); 
         dwReturn["KAZKZSTD"] = " ".PadRight(1 ); 
         dwReturn["KAZSTDAB"] = " ".PadRight(0 ); 
         dwReturn["KAZSTDAEND"] = " ".PadRight(1 ); 
         dwReturn["KAZPRFVK"] = " ".PadRight(1 ); 
         dwReturn["KAZSTAFF"] = " ".PadRight(1 ); 
         dwReturn["KAZOLAEAEND"] = " ".PadRight(1 ); 
         dwReturn["KAZWRI"] = " ".PadRight(2 ); 
         dwReturn["KAZLANDI"] = " ".PadRight(3 ); 
         dwReturn["KAZWRE"] = " ".PadRight(2 ); 
         dwReturn["KAZLANDE"] = " ".PadRight(3 ); 
         dwReturn["KAZFKZG"] = " ".PadRight(1 ); 
         dwReturn["KAZPARTG"] = " ".PadRight(5 ); 
         dwReturn["KAZGUEG"] = " ".PadRight(1 ); 
         dwReturn["KAZZUPG"] = " ".PadRight(0 ); 
         dwReturn["KAZZUSCHLG1"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLG2"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLG3"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLG4"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLG5"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLG6"] = " ".PadRight(8 ); 
         dwReturn["KAZMGKMMG"] = " ".PadRight(8 ); 
         dwReturn["KAZFKZKG"] = " ".PadRight(1 ); 
         dwReturn["KAZPARTKG"] = " ".PadRight(5 ); 
         dwReturn["KAZGUEKG"] = " ".PadRight(1 ); 
         dwReturn["KAZZUPKG"] = " ".PadRight(0 ); 
         dwReturn["KAZZUSCHLKG1"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLKG2"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLKG3"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLKG4"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLKG5"] = " ".PadRight(8 ); 
         dwReturn["KAZZUSCHLKG6"] = " ".PadRight(8 ); 
         dwReturn["KAZKZZUKG"] = " ".PadRight(1 ); 
         dwReturn["KAZMGKMMKG"] = " ".PadRight(8 ); 
         dwReturn["KAZFELDK"] = " ".PadRight(1 ); 
         dwReturn["KAZFKZK"] = " ".PadRight(1 ); 
         dwReturn["KAZZUPK"] = " ".PadRight(0 ); 
         dwReturn["KAZMGKMMK"] = " ".PadRight(8 ); 
         dwReturn["KAZFKZA"] = " ".PadRight(1 ); 
         dwReturn["KAZPARTA"] = " ".PadRight(5 ); 
         dwReturn["KAZGUEA"] = " ".PadRight(1 ); 
         dwReturn["KAZZUPA"] = " ".PadRight(0 ); 
         dwReturn["KAZMGKMMA"] = " ".PadRight(8 ); 
         dwReturn["KAZFKZM"] = " ".PadRight(1 ); 
         dwReturn["KAZFELDM"] = " ".PadRight(1 ); 
         dwReturn["KAZZUPM"] = " ".PadRight(0 ); 
         dwReturn["KAZMGKMMM"] = " ".PadRight(8 ); 
         dwReturn["KAZZUPRF"] = " ".PadRight(0 ); 
         dwReturn["KAZZUPRC"] = " ".PadRight(0 ); 
         dwReturn["KAZMGKMMRF"] = " ".PadRight(8 ); 
         dwReturn["KAZMGKMMRC"] = " ".PadRight(8 ); 
         dwReturn["KAZKS1B"] = " ".PadRight(5 ); 
         dwReturn["KAZGUEB"] = " ".PadRight(1 ); 
         dwReturn["KAZZUPB"] = " ".PadRight(0 ); 
         dwReturn["KAZPROGRP"] = " ".PadRight(1 ); 
         dwReturn["KAZFDAT"] = " ".PadRight(0 ); 
         dwReturn["KAZZUPF"] = " ".PadRight(0 ); 
         dwReturn["KAZKOLL"] = " ".PadRight(5 ); 
         dwReturn["KAZUMREF"] = " ".PadRight(0 ); 
         dwReturn["KAZFILLER"] = " ".PadRight(95 ); 
                    #endregion
                    break;
                case "JLT":

                    break;
                default:

                    break;
            }
            if (IsConvert)
            {
                foreach (DataColumn cm in dwInput.Table.Columns)
                {
                    if (dwInput[cm.ColumnName].ToString() == "")
                        continue;
                    if (dwReturn.Table.Columns.Contains(cm.ColumnName))
                    {
                        dwReturn[cm.ColumnName] = dwInput[cm.ColumnName];
                    }
                }
            }
            return dwReturn;
        }
        public void MapKAZWECK(ref DataRow dwLocal, DataRow dwData)
        {
            BlindMap(ref dwLocal, dwData);
        }
        public void SaveKAZWECK(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            DataSet setResult = new DataSet();
            DataTable tbLocal = null;
            DataRow dwLocal = null;
            bool flgExist = false;
            setResult = QueryKAZWECK(dwData);
            if (setResult.Tables.Count > 0)
            {
                tbLocal = setResult.Tables[0];
                if (tbLocal.Rows.Count > 0)
                {
                    flgExist = true;
                    dwLocal = tbLocal.Rows[0];
                }
                else
                {
                    dwLocal = tbLocal.NewRow();
                }
            }
            MapKAZWECK(ref dwLocal, dwData);

            if (!flgExist)
            {

                InsertKAZWECK(dwLocal, ITXDBVERSION);
            }
            UpdateKAZWECK(dwLocal);
        }
        public void InsertKAZWECK(DataRow dwData, string ITXDBVERSION = "50.24")
        {
            OracleCommand or1;
            or1 = OracleDB.CreateCommand();
            switch (ITXDBVERSION)
            {
                case "YGR":
                    or1.CommandText = "INSERT INTO KAZWECK(VAKBMANDANT, VAKBKOLL, VAKBART, VAKBKUNDNR, VAKBFARBE, VAKBKDARTNR, VAKBKDARTBEZ, VAKBKDFARBNR, VAKBANDRUCK, VAKBMEGEW, VAKBMENGEH, VAKBGEWVON, VAKBGEWBIS, VAKBGEWCA, VAKBGEWFKT, VAKBGEWGRP, VAKBMEGFKT, VAKBMEGGRP, VAKBAENDZL, VAKBAENDBEN, VAKBAENDDAT, VAKBNEUBEN, VAKBNEUDAT, VAKBFILLER)"
                        + " VALUES (:VAKBMANDANT, :VAKBKOLL, :VAKBART, :VAKBKUNDNR, :VAKBFARBE, '                         ', '                         ', '                             ', ' ', '   ', '   ', 0, 0, ' ', '000000000000', ' ', '000000000000', ' ', 0, '        ', '000000', '        ', '      ', '                                          ')";
                    or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                //VAFMANDANT VAFKOLL VAFART VAFFARBE VAFBEZ VAFFFARBE

            }
            
            Connect2Proxy(or1);
        }
        public DataSet QueryKAZWECK(DataRow dwData, int option = 1)
        {
            DataSet Return;
            DataSet Result = new DataSet();
            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 0:
                    or1.CommandText = "SELECT * FROM KAZWECK WHERE  ROWNUM<2 ";
                    break;
              
                case 99:
                    or1.CommandText = "SELECT * FROM KAZWECK  WHERE ROWNUM<50";
                    break;
                default:
                    break;
            }
            Result = Connect2Proxy(or1);
            if (Result.Tables.Count > 0)
                Result.Tables[0].TableName = "KAZWECK";
            Return = Result;
            return Return;
        }
        public void DeleteKAZWECK(DataRow dwData, int option = 1)
        {

            OracleCommand or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    or1.CommandText = "DELETE FROM KAZWECK   WHERE  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                     or1.Parameters.Add("VAKBMANDANT", OracleType.NVarChar).Value = dwData["VAKBMANDANT"].ToString();
                    or1.Parameters.Add("VAKBKOLL", OracleType.NVarChar).Value = dwData["VAKBKOLL"].ToString();
                    or1.Parameters.Add("VAKBART", OracleType.NVarChar).Value = dwData["VAKBART"].ToString();
                    or1.Parameters.Add("VAKBFARBE", OracleType.NVarChar).Value = dwData["VAKBFARBE"].ToString();
                    or1.Parameters.Add("VAKBKUNDNR", OracleType.NVarChar).Value = dwData["VAKBKUNDNR"].ToString();
                    break;
                default:
                    break;
            }
            Connect2Proxy(or1);
        } 
      
        public void UpdateKAZWECK(DataRow dwData, string ITXDBVERSION = "50.24", int option = 1)
        {
            OracleCommand or1;
            DataSet Result = new DataSet();
            or1 = OracleDB.CreateCommand();
            switch (option)
            {
                case 1:
                    #region====Command==== 
                    or1.CommandText = "UPDATE KAZWECK SET "
                    +"KAZMANDANT= :KAZMANDANT,"
                    +"KAZZWECK= :KAZZWECK,"
                    +"KAZVER= :KAZVER,"
                    +"KAZAENZL= :KAZAENZL,"
                    +"KAZAENB= :KAZAENB,"
                    +"KAZAEND= :KAZAEND,"
                    +"KAZNEUB= :KAZNEUB,"
                    +"KAZNEUD= :KAZNEUD,"
                    +"KAZBEZ= :KAZBEZ,"
                    +"KAZGUELT= :KAZGUELT,"
                    +"KAZSCHEM= :KAZSCHEM,"
                    +"KAZKZSTD= :KAZKZSTD,"
                    +"KAZSTDAB= :KAZSTDAB,"
                    +"KAZSTDAEND= :KAZSTDAEND,"
                    +"KAZPRFVK= :KAZPRFVK,"
                    +"KAZSTAFF= :KAZSTAFF,"
                    +"KAZOLAEAEND= :KAZOLAEAEND,"
                    +"KAZWRI= :KAZWRI,"
                    +"KAZLANDI= :KAZLANDI,"
                    +"KAZWRE= :KAZWRE,"
                    +"KAZLANDE= :KAZLANDE,"
                    +"KAZFKZG= :KAZFKZG,"
                    +"KAZPARTG= :KAZPARTG,"
                    +"KAZGUEG= :KAZGUEG,"
                    +"KAZZUPG= :KAZZUPG,"
                    +"KAZZUSCHLG1= :KAZZUSCHLG1,"
                    +"KAZZUSCHLG2= :KAZZUSCHLG2,"
                    +"KAZZUSCHLG3= :KAZZUSCHLG3,"
                    +"KAZZUSCHLG4= :KAZZUSCHLG4,"
                    +"KAZZUSCHLG5= :KAZZUSCHLG5,"
                    +"KAZZUSCHLG6= :KAZZUSCHLG6,"
                    +"KAZMGKMMG= :KAZMGKMMG,"
                    +"KAZFKZKG= :KAZFKZKG,"
                    +"KAZPARTKG= :KAZPARTKG,"
                    +"KAZGUEKG= :KAZGUEKG,"
                    +"KAZZUPKG= :KAZZUPKG,"
                    +"KAZZUSCHLKG1= :KAZZUSCHLKG1,"
                    +"KAZZUSCHLKG2= :KAZZUSCHLKG2,"
                    +"KAZZUSCHLKG3= :KAZZUSCHLKG3,"
                    +"KAZZUSCHLKG4= :KAZZUSCHLKG4,"
                    +"KAZZUSCHLKG5= :KAZZUSCHLKG5,"
                    +"KAZZUSCHLKG6= :KAZZUSCHLKG6,"
                    +"KAZKZZUKG= :KAZKZZUKG,"
                    +"KAZMGKMMKG= :KAZMGKMMKG,"
                    +"KAZFELDK= :KAZFELDK,"
                    +"KAZFKZK= :KAZFKZK,"
                    +"KAZZUPK= :KAZZUPK,"
                    +"KAZMGKMMK= :KAZMGKMMK,"
                    +"KAZFKZA= :KAZFKZA,"
                    +"KAZPARTA= :KAZPARTA,"
                    +"KAZGUEA= :KAZGUEA,"
                    +"KAZZUPA= :KAZZUPA,"
                    +"KAZMGKMMA= :KAZMGKMMA,"
                    +"KAZFKZM= :KAZFKZM,"
                    +"KAZFELDM= :KAZFELDM,"
                    +"KAZZUPM= :KAZZUPM,"
                    +"KAZMGKMMM= :KAZMGKMMM,"
                    +"KAZZUPRF= :KAZZUPRF,"
                    +"KAZZUPRC= :KAZZUPRC,"
                    +"KAZMGKMMRF= :KAZMGKMMRF,"
                    +"KAZMGKMMRC= :KAZMGKMMRC,"
                    +"KAZKS1B= :KAZKS1B,"
                    +"KAZGUEB= :KAZGUEB,"
                    +"KAZZUPB= :KAZZUPB,"
                    +"KAZPROGRP= :KAZPROGRP,"
                    +"KAZFDAT= :KAZFDAT,"
                    +"KAZZUPF= :KAZZUPF,"
                    +"KAZKOLL= :KAZKOLL,"
                    +"KAZUMREF= :KAZUMREF,"
                    +"KAZFILLER= :KAZFILLER,"
                        + " WHERE  "
                        + "  VAKBMANDANT=:VAKBMANDANT AND VAKBKOLL=:VAKBKOLL AND VAKBART =:VAKBART AND VAKBFARBE=:VAKBFARBE AND VAKBKUNDNR=:VAKBKUNDNR";
                    #endregion

                    #region====Parameters====
          or1.Parameters.Add("KAZMANDANT", OracleType.NVarChar).Value = dwData["KAZMANDANT"].ToString(); 
          or1.Parameters.Add("KAZZWECK", OracleType.NVarChar).Value = dwData["KAZZWECK"].ToString(); 
          or1.Parameters.Add("KAZVER", OracleType.NVarChar).Value = dwData["KAZVER"].ToString(); 
          or1.Parameters.Add("KAZAENZL", OracleType.NVarChar).Value = dwData["KAZAENZL"].ToString(); 
          or1.Parameters.Add("KAZAENB", OracleType.NVarChar).Value = dwData["KAZAENB"].ToString(); 
          or1.Parameters.Add("KAZAEND", OracleType.NVarChar).Value = dwData["KAZAEND"].ToString(); 
          or1.Parameters.Add("KAZNEUB", OracleType.NVarChar).Value = dwData["KAZNEUB"].ToString(); 
          or1.Parameters.Add("KAZNEUD", OracleType.NVarChar).Value = dwData["KAZNEUD"].ToString(); 
          or1.Parameters.Add("KAZBEZ", OracleType.NVarChar).Value = dwData["KAZBEZ"].ToString(); 
          or1.Parameters.Add("KAZGUELT", OracleType.NVarChar).Value = dwData["KAZGUELT"].ToString(); 
          or1.Parameters.Add("KAZSCHEM", OracleType.NVarChar).Value = dwData["KAZSCHEM"].ToString(); 
          or1.Parameters.Add("KAZKZSTD", OracleType.NVarChar).Value = dwData["KAZKZSTD"].ToString(); 
          or1.Parameters.Add("KAZSTDAB", OracleType.NVarChar).Value = dwData["KAZSTDAB"].ToString(); 
          or1.Parameters.Add("KAZSTDAEND", OracleType.NVarChar).Value = dwData["KAZSTDAEND"].ToString(); 
          or1.Parameters.Add("KAZPRFVK", OracleType.NVarChar).Value = dwData["KAZPRFVK"].ToString(); 
          or1.Parameters.Add("KAZSTAFF", OracleType.NVarChar).Value = dwData["KAZSTAFF"].ToString(); 
          or1.Parameters.Add("KAZOLAEAEND", OracleType.NVarChar).Value = dwData["KAZOLAEAEND"].ToString(); 
          or1.Parameters.Add("KAZWRI", OracleType.NVarChar).Value = dwData["KAZWRI"].ToString(); 
          or1.Parameters.Add("KAZLANDI", OracleType.NVarChar).Value = dwData["KAZLANDI"].ToString(); 
          or1.Parameters.Add("KAZWRE", OracleType.NVarChar).Value = dwData["KAZWRE"].ToString(); 
          or1.Parameters.Add("KAZLANDE", OracleType.NVarChar).Value = dwData["KAZLANDE"].ToString(); 
          or1.Parameters.Add("KAZFKZG", OracleType.NVarChar).Value = dwData["KAZFKZG"].ToString(); 
          or1.Parameters.Add("KAZPARTG", OracleType.NVarChar).Value = dwData["KAZPARTG"].ToString(); 
          or1.Parameters.Add("KAZGUEG", OracleType.NVarChar).Value = dwData["KAZGUEG"].ToString(); 
          or1.Parameters.Add("KAZZUPG", OracleType.NVarChar).Value = dwData["KAZZUPG"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLG1", OracleType.NVarChar).Value = dwData["KAZZUSCHLG1"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLG2", OracleType.NVarChar).Value = dwData["KAZZUSCHLG2"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLG3", OracleType.NVarChar).Value = dwData["KAZZUSCHLG3"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLG4", OracleType.NVarChar).Value = dwData["KAZZUSCHLG4"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLG5", OracleType.NVarChar).Value = dwData["KAZZUSCHLG5"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLG6", OracleType.NVarChar).Value = dwData["KAZZUSCHLG6"].ToString(); 
          or1.Parameters.Add("KAZMGKMMG", OracleType.NVarChar).Value = dwData["KAZMGKMMG"].ToString(); 
          or1.Parameters.Add("KAZFKZKG", OracleType.NVarChar).Value = dwData["KAZFKZKG"].ToString(); 
          or1.Parameters.Add("KAZPARTKG", OracleType.NVarChar).Value = dwData["KAZPARTKG"].ToString(); 
          or1.Parameters.Add("KAZGUEKG", OracleType.NVarChar).Value = dwData["KAZGUEKG"].ToString(); 
          or1.Parameters.Add("KAZZUPKG", OracleType.NVarChar).Value = dwData["KAZZUPKG"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLKG1", OracleType.NVarChar).Value = dwData["KAZZUSCHLKG1"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLKG2", OracleType.NVarChar).Value = dwData["KAZZUSCHLKG2"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLKG3", OracleType.NVarChar).Value = dwData["KAZZUSCHLKG3"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLKG4", OracleType.NVarChar).Value = dwData["KAZZUSCHLKG4"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLKG5", OracleType.NVarChar).Value = dwData["KAZZUSCHLKG5"].ToString(); 
          or1.Parameters.Add("KAZZUSCHLKG6", OracleType.NVarChar).Value = dwData["KAZZUSCHLKG6"].ToString(); 
          or1.Parameters.Add("KAZKZZUKG", OracleType.NVarChar).Value = dwData["KAZKZZUKG"].ToString(); 
          or1.Parameters.Add("KAZMGKMMKG", OracleType.NVarChar).Value = dwData["KAZMGKMMKG"].ToString(); 
          or1.Parameters.Add("KAZFELDK", OracleType.NVarChar).Value = dwData["KAZFELDK"].ToString(); 
          or1.Parameters.Add("KAZFKZK", OracleType.NVarChar).Value = dwData["KAZFKZK"].ToString(); 
          or1.Parameters.Add("KAZZUPK", OracleType.NVarChar).Value = dwData["KAZZUPK"].ToString(); 
          or1.Parameters.Add("KAZMGKMMK", OracleType.NVarChar).Value = dwData["KAZMGKMMK"].ToString(); 
          or1.Parameters.Add("KAZFKZA", OracleType.NVarChar).Value = dwData["KAZFKZA"].ToString(); 
          or1.Parameters.Add("KAZPARTA", OracleType.NVarChar).Value = dwData["KAZPARTA"].ToString(); 
          or1.Parameters.Add("KAZGUEA", OracleType.NVarChar).Value = dwData["KAZGUEA"].ToString(); 
          or1.Parameters.Add("KAZZUPA", OracleType.NVarChar).Value = dwData["KAZZUPA"].ToString(); 
          or1.Parameters.Add("KAZMGKMMA", OracleType.NVarChar).Value = dwData["KAZMGKMMA"].ToString(); 
          or1.Parameters.Add("KAZFKZM", OracleType.NVarChar).Value = dwData["KAZFKZM"].ToString(); 
          or1.Parameters.Add("KAZFELDM", OracleType.NVarChar).Value = dwData["KAZFELDM"].ToString(); 
          or1.Parameters.Add("KAZZUPM", OracleType.NVarChar).Value = dwData["KAZZUPM"].ToString(); 
          or1.Parameters.Add("KAZMGKMMM", OracleType.NVarChar).Value = dwData["KAZMGKMMM"].ToString(); 
          or1.Parameters.Add("KAZZUPRF", OracleType.NVarChar).Value = dwData["KAZZUPRF"].ToString(); 
          or1.Parameters.Add("KAZZUPRC", OracleType.NVarChar).Value = dwData["KAZZUPRC"].ToString(); 
          or1.Parameters.Add("KAZMGKMMRF", OracleType.NVarChar).Value = dwData["KAZMGKMMRF"].ToString(); 
          or1.Parameters.Add("KAZMGKMMRC", OracleType.NVarChar).Value = dwData["KAZMGKMMRC"].ToString(); 
          or1.Parameters.Add("KAZKS1B", OracleType.NVarChar).Value = dwData["KAZKS1B"].ToString(); 
          or1.Parameters.Add("KAZGUEB", OracleType.NVarChar).Value = dwData["KAZGUEB"].ToString(); 
          or1.Parameters.Add("KAZZUPB", OracleType.NVarChar).Value = dwData["KAZZUPB"].ToString(); 
          or1.Parameters.Add("KAZPROGRP", OracleType.NVarChar).Value = dwData["KAZPROGRP"].ToString(); 
          or1.Parameters.Add("KAZFDAT", OracleType.NVarChar).Value = dwData["KAZFDAT"].ToString(); 
          or1.Parameters.Add("KAZZUPF", OracleType.NVarChar).Value = dwData["KAZZUPF"].ToString(); 
          or1.Parameters.Add("KAZKOLL", OracleType.NVarChar).Value = dwData["KAZKOLL"].ToString(); 
          or1.Parameters.Add("KAZUMREF", OracleType.NVarChar).Value = dwData["KAZUMREF"].ToString(); 
          or1.Parameters.Add("KAZFILLER", OracleType.NVarChar).Value = dwData["KAZFILLER"].ToString(); 
                    #endregion
                    break; 
                default:
                    break;
            }


            Connect2Proxy(or1);
        }
    }
}
